#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

struct room {
	long long x, w;
	room (long long x, long long w) {
		this->x = x;
		this->w = w;
	}
};

bool cmp(room x, room y) {
	return x.x + x.w < y.x + y.w;
}

vector<room> a;

int main() {
	long long n, ans = 0;
	long long m, x, t;
	scanf("%lld %lld", &n, &m);
	for (long long i = 1; i <= n; ++i) {
		scanf("%lld %lld", &x, &t);
		//if (x > m) continue;
		a.push_back(room(x, t));
	}
	long long lastx = 0, used_time = 0;
	sort(a.begin(), a.end(), cmp);
	for (unsigned h = 0; h < a.size(); ++h) {
		if (used_time + a[h].x + a[h].w - lastx > m)break;
        used_time += a[h].w + a[h].x - lastx;
        lastx = a[h].x;
        ++ans;
	}
	printf("%lld\n", ans);
	return 0;
} 
